<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:t="http://myfaces.apache.org/tomahawk"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:f="http://java.sun.com/jsf/core">
   <script type="text/javascript" src="http://code.jquery.com/jquery-1.8.1.min.js"></script>

  <head>
      
    <title>SupportIT</title>
    <meta http-equiv="content-type" content="text/html; charset=utf-8" />
    <f:metadata>
        <f:viewParam name="idno" value="#{modulenbean.modulenId}" />
    </f:metadata>
  </head>
  <h:body>
    <ui:include src="/templates/layout.xhtml" />
      <div class="wrapper">
          
          <a href="#signout" style="float:right; color:#ffa52c; margin-top:-27px;
             font-size:16px; font-weight: bold;">Logg ut</a>
             
          <div class="box">
      


	
	<div id="background">
            
		<h:form id="text_statistic"><b>Modul #{modulenbean.modulenId}</b></h:form> 
    
                <div class="back"><a href="/prosjekt/admin/moduler.xhtml">Tilbake</a></div>
                       
	<div class="tfclear"></div>
        
        </div>
              <div class="wrapper-modul-text-left">
          <br />    
          <b>Informasjon om modul #{modulenbean.modulenId}</b>
              <br />
                   
                
                  <h:form>
                   <h:inputTextarea id="task" rows="10" cols="30" label="task" 
                           value="#{modulenbean.task}" rendered="#{modulenbean.updating}"/>
                   <br /><br />
          <b>Krav om modul #{modulenbean.modulenId}</b>  <br />  
                   <h:inputTextarea id="requirements" rows="10" cols="30" label="requirements" 
                           value="#{modulenbean.requirements}" rendered="#{modulenbean.updating}"/>
                   
                   <br /><br />
                   
           <b>Tidsfrist modul #{modulenbean.modulenId}</b>  <br />  
                   <h:inputText id="dato" label="dato" 
                                value="#{modulenbean.dato}" rendered="#{modulenbean.updating}">
                   <f:convertDateTime pattern="MM/dd/yyyy" />
                   </h:inputText>
                   
                   <br /><br />
          
          <h:commandButton value="Lagre" action="#{modulenbean.saveModulen()}"></h:commandButton>
             </h:form>
            
       
          
          
          
              </div>
            
              
        
          
          <div class="modul-right" style="float:right;">
              <div class="resource-box-1">
              
              <b>Last opp filer som er nødvendig<br /> i læringsprosessen til modul #{modulenbean.modulenId}.</b>
        <h:form enctype="multipart/form-data">
          <h:panelGrid columns="2">
            <h:outputLabel value="Velg fil for å laste opp" for="file"/>
            <t:inputFileUpload value="#{fileBean.file}" id="file" />
          </h:panelGrid>
          <h:commandButton value="Last opp" action="#{fileBean.submit}" />
          <h:messages />
        </h:form>

              <p>Her har du en oversik over alle filene til modul #{modulenbean.modulenId}.<br /> Klikk på et filnavn for å laste den ned.</p>
        <h:dataTable value="#{fileBean.files}" var="f">
          <h:column>
            <f:facet name="header">Filnavn</f:facet>
            <!-- this is a download link, note the use of the
            ordinary html a tag, rather than the JSF h:link.
            This is necessary because the link is to a servlet,
            no to another facelet -->
            <a href="/prosjekt/download?id=#{f.id}" style="color:black;">#{f.name}</a>
          </h:column>
          <h:column>
            <f:facet name="header">Filtype</f:facet>
            #{f.contentType}
          </h:column>
          <h:column>
            <f:facet name="header">Størrelse</f:facet>
            #{f.fileSize}
          </h:column>
        </h:dataTable>

              </div>
          </div>
              
          </div>
          
              
          </div>
      
  </h:body>
</html>